<!DOCTYPE html>
<html>
<body>

<!-- 视频播放器 -->
<video id="videoPlayer" width="640" height="360" controls>
  <source src="top1.mp4" type="video/mp4"> <!-- 替换为你的视频文件 -->
  Your browser does not support the video tag.
</video>

<script>
let video = document.getElementById('videoPlayer');
let lastTime = 0; // 上次记录的时间点
let tolerance = 1.0; // 容忍的时间差，例如1秒

video.ontimeupdate = function() {
  let currentTime = video.currentTime;
  if (currentTime > lastTime + tolerance) { // 如果超出容忍时间差，则重置为 lastTime
    video.currentTime = lastTime;
  } else {
    lastTime = currentTime; // 正常播放时更新 lastTime
  }
};

video.onseeking = function() {
  if (video.currentTime > lastTime + tolerance) {
    video.currentTime = lastTime;
  }
};

</script>

</body>
</html>
